﻿using System;
using System.Runtime.CompilerServices;
using LiveCharts.Helpers;
using LiveCharts.Wpf;

namespace LiveCharts.Wpf
{
    public class GearedSeries : Series
    {
        internal ShapesStroke ShapesStroke { get; set; }

        public override void OnSeriesUpdateStart()
        {
            if (ShapesStroke == null)
            {
                ShapesStroke = new ShapesStroke();
            }
            ShapesStroke.method_0(Fill, Stroke, this);
        }
        public override void Erase(bool removeFromView = true)
        {

            ActualValues.GetPoints(this).ForEach(zz =>
            {
                if (zz.View != null)
                {
                    zz.View.RemoveFromView(Model.Chart);
                }
            });
            if (removeFromView)
            {
                if (ShapesStroke != null)
                {
                    Model.Chart.View.RemoveFromDrawMargin(ShapesStroke.Path_0);
                }
                Model.Chart.View.RemoveFromView(this);
            }
        }
    }
}
